/*   **********************************************************************  **
 **   Copyright notice                                                       **
 **                                                                          **
 **   (c) 2009, Around(J2)ME				                                 **
 **   All rights reserved.                                                   **
 **                                                                          **
 **   This program and the accompanying materials are made available under   **
 **   the terms of the New BSD License which accompanies this    			 **
 **   distribution.											                 **
 **   A copy is found in the textfile LICENSE.txt							 **
 **                                                                          **
 **   This copyright notice MUST APPEAR in all copies of the file!           **
 **                                                                          **
 **   Main developers:                                                       **
 **     Juri Strumpflohner		http://blog.js-development.com	             **
 **		Matthias Braunhofer		http://matthias.jimdo.com                    **
 **                                                                          **
 **  **********************************************************************  */

package com.aroundj2me.view;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;

import com.aroundj2me.controller.ScreenController;
import com.aroundj2me.main.AroundJ2ME;

public class AboutForm extends Form implements CommandListener {
	private StringItem item;
	
	public AboutForm() {
		super("About Around(J2)ME");
		initialize();
		this.setCommandListener(this);
	}
	
	private void initialize(){
		item = new StringItem("Name: ", AroundJ2ME.getInstance().getAppProperty("MIDlet-Name"));
		this.append(item);
		item = new StringItem("Vendor: ",AroundJ2ME.getInstance().getAppProperty("MIDlet-Vendor"));
		this.append(item);
		item = new StringItem("Version: ",AroundJ2ME.getInstance().getAppProperty("MIDlet-Version"));
		this.append(item);
		item = new StringItem("Authors: ",AroundJ2ME.getInstance().getAppProperty("AROUNDJ2MEAuthor"));
		this.append(item);
		item = new StringItem("Website: ", AroundJ2ME.getInstance().getAppProperty("Website"));
		this.append(item);
	}

	public void commandAction(Command c, Displayable d) {
		if(c.getCommandType() == Command.BACK){
			ScreenController.getInstance().last();
		}
	}
}
